var e = function(e) {
    if (e && e.__esModule) return e;
    var t = {};
    if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
    return t.default = e, t;
}(require("../card-scanner-form/card-scanner"));

Component({
    properties: {
        file: {
            type: String,
            value: ""
        },
        loading: {
            type: Boolean,
            value: !1
        }
    },
    methods: {
        onChooseAlbum: function() {
            var t = this;
            e.chooseImage("album").then(function(e) {
                t.triggerEvent("onsuccess", {
                    file: e
                });
            });
        },
        onTakePhoto: function() {
            var e = this;
            wx.createCameraContext().takePhoto({
                quality: "high",
                success: function(t) {
                    var n = t.tempImagePath;
                    e.triggerEvent("onsuccess", {
                        file: n
                    });
                }
            });
        },
        onCancel: function() {
            wx.navigateBack({
                delta: 1
            });
        },
        onError: function() {
            var e = this;
            wx.showModal({
                title: "相机授权失败",
                content: "小程序正常运行需要获得相机功能。请在发现-小程序，删除本小程序后，再次打开，会重新提示微信授信，点“允许”，即可正常使用相机功能...",
                showCancel: !1,
                success: function() {
                    return e.triggerEvent("onfail", {});
                }
            });
        }
    }
});